package com.mjf.ue.enums;

import cn.hutool.core.collection.ListUtil;
import lombok.Getter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * desc U8接口枚举
 * </p>
 *
 * @author chenshoumeng
 * @date 2025/6/3 14:38
 */
@Getter
public enum UEApiEnum {

    UE_API_PRODUCT_IN_LIST_URL("201", "产成品入库单列表查询", "/api/productinlist/batch_get"),
    UE_API_PRODUCT_IN_LIST_DETAIL_URL("202", "产成品入库单详情查询", "/api/productin/get"),
    UE_API_BARCODE_LIST_URL("203", "条码档案", "/api/barcode/batch_get"),
    ;

    private static final Map<String, UEApiEnum> LOOKUP_MAP = new HashMap<>(4, 1);

    static {
        for (UEApiEnum cstEnum : UEApiEnum.values()) {
            LOOKUP_MAP.put(cstEnum.codes, cstEnum);
        }
    }

    UEApiEnum(String codes, String name, String url) {
        this.codes = codes;
        this.name = name;
        this.url = url;
    }

    /**
     * -- GETTER --
     *
     * @return 枚举值
     */
    private String codes;
    private String name;
    private String url;



    /**
     * 根据枚举值获取枚举
     *
     * @param codes codes
     * @return 若枚举值存在，返回对应的枚举，否则返回 null
     */
    public static UEApiEnum formValue(String codes) {
        return LOOKUP_MAP.get(codes);
    }



}
